package log

type Options struct {
	OutputPaths       []string `json:"output-paths" mapstructure:"output-paths"`
	ErrorOutputPaths  []string `json:"error-output-paths" mapstructure:"error-output-paths"`
	Level             string   `json:"level" mapstructure:"level"`
	Format            string   `json:"format" mapstructure:"format"`
	DisableCaller     bool     `json:"disable-caller" mapstructure:"disable-caller"`
	DisableStacktrace bool     `json:"disable-stacktrace" mapstructure:"disable-stacktrace"`
	EnableColor       bool     `json:"enable-color"       mapstructure:"enable-color"`
	Development       bool     `json:"development"        mapstructure:"development"`
	Name              string   `json:"name"               mapstructure:"name"`
	EnableTraceID     bool     `json:"enable-trace-id"     mapstructure:"enable-trace-id"`   //是否开启traceID
	EnableTraceStack  bool     `json:"enable-trace-stack" mapstructure:"enable-trace-stack"` //是否开启traceStack
}

type Option func(options *Options) Options

func NewOptions(opts ...Option) *Options {

	options := &Options{
		Level: "info",
	}
	for _, opt := range opts {
		opt(options)
	}
	return options
}

func WithLevel(options *Options) *Options {

	options.Level = "info"
	return options
}
